]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Rebuild struts and the input region when the Shell starts up
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 20 Feb 2013 04:21:35 +0000 (23:21 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 20 Feb 2013 16:36:19 +0000 (11:36 -0500)
This means that windows will be positioned correctly with respect
to the panel when the shell starts up, and there won't be adjusting
after the session animation zooms in entirely.

https://bugzilla.gnome.org/show_bug.cgi?id=694227

js/ui/layout.js
js/ui/main.js

index 81909f12212e7ead1ca2447f751dba6e7d43d904..994d79c30292d10bca6ac2f8df0a3ff6e27fd818 100644 (file)
@@ -221,7 +221,6 @@ const LayoutManager = new Lang.Class({
         global.screen.connect('monitors-changed',
                               Lang.bind(this, this._monitorsChanged));
         this._monitorsChanged();
-        this._prepareStartupAnimation();
     },
 
     // This is called by Main after everything else is constructed;
@@ -537,7 +536,7 @@ const LayoutManager = new Lang.Class({
     // MetaBackgroundActor inside global.window_group covers the entirety of the
     // screen. So, we set no_clear_hint at the end of the animation.
 
-    _prepareStartupAnimation: function() {
+    prepareStartupAnimation: function() {
         // Set ourselves to FULLSCREEN input mode while the animation is running
         // so events don't get delivered to X11 windows (which are distorted by the animation)
         global.stage_input_mode = Shell.StageInputMode.FULLSCREEN;
@@ -556,6 +555,10 @@ const LayoutManager = new Lang.Class({
         if (Main.sessionMode.isGreeter) {
             this.panelBox.translation_y = -this.panelBox.height;
         } else {
+            // We need to force an update of the regions now before we scale
+            // the UI group to get the coorect allocation for the struts.
+            this._updateRegions();
+
             this.trayBox.hide();
             this.keyboardBox.hide();
 
@@ -613,6 +616,8 @@ const LayoutManager = new Lang.Class({
             this._createSecondaryBackgrounds();
 
         this.emit('panel-box-changed');
+
+        this._queueUpdateRegions();
     },
 
     showKeyboard: function () {
@@ -829,6 +834,9 @@ const LayoutManager = new Lang.Class({
         if (Main.sessionMode.isGreeter)
             return;
 
+        if (this._startingUp)
+            return;
+
         if (!this._updateRegionIdle)
             this._updateRegionIdle = Mainloop.idle_add(Lang.bind(this, this._updateRegions),
                                                        Meta.PRIORITY_BEFORE_REDRAW);
index fa42f255322f99ded86f05fff32ce46c63914952..ee44dcfe7c7cd9de5ddcc9c1a0f4d6fd823e71a7 100644 (file)
@@ -152,6 +152,7 @@ function startSession() {
     componentManager = new Components.ComponentManager();
 
     layoutManager.init();
+    layoutManager.prepareStartupAnimation();
     overview.init();
 
     global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,